from flask import Blueprint, request, url_for, session, redirect

admin_blue = Blueprint("admin", __name__)

from . import views



@admin_blue.before_request
def before_request():
    if not request.url.endswith(url_for("admin.admin_login")):
        is_admin = session.get("is_admin", False)
        if  not is_admin:
            return redirect("/")
